<?php namespace Zmsun\Filesystem;class Assist{public static function createDirByFile($file){$file=str_replace('\\','/',$file);if(($slashPos=strrpos($file,'/'))&&strpos($file,':')+1!==$slashPos){$path=substr($file,0,$slashPos);if(!file_exists($path)and !@mkdir($path,0777,true)){return false;}}return true;}public static function createFile($path,$content=''){if(file_exists($path)){return false===file_put_contents($path,$content)? false:true;}if(!static::createDirByFile($path)||!($resource=@fopen($path,'w'))||$content!==''&&false===fwrite($resource,$content)){return false;}fclose($resource);return true;}}?>